﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QXBook.Utils;

namespace QXBook.Model
{
    /// <summary>
    /// 产品
    /// </summary>
    public class ProductInfo : CoreTemplate, IModelBase
    {
        public int ProductID { get; set; }
        /// <summary>
        /// 销售量
        /// </summary>
        public int Sales { get; set; }
        /// <summary>
        /// 收藏量
        /// </summary>
        public int Favorites { get; set; }

        public decimal Price { get; set; }

        #region QXBook专用
        /// <summary>
        /// 出版社
        /// </summary>
        public string PublishHourse { get; set; }

        /// <summary>
        /// 是否有库存
        /// </summary>
        public YesNo IsInstock { get; set; }
        #endregion

        public int ID
        {
            get { return ProductID; }
        }

        public string ListImg
        {
            get { return string.IsNullOrEmpty(SmallImg) ? "/images/nophoto.jpg" : SmallImg; }
        }
    }
}
